﻿using System.Reflection;

namespace XamlInspector.Model.Properties
{
    public class XamlBooleanProperty : XamlProperty
    {
        private readonly PropertyInfo _propertyInfo;
        private readonly object _element;

        public XamlBooleanProperty(PropertyInfo propertyInfo, object element)
            : base(propertyInfo, element)
        {
            _propertyInfo = propertyInfo;
            _element = element;
        }

        public bool Value
        {
            get { return (bool)_propertyInfo.GetValue(_element); }
            set { _propertyInfo.SetValue(_element, value); }
        }
    }
}
